#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;


int maxValue(vector<vector<int> >& grid) {
    int n = grid.size(), m = grid[0].size();

    for (int i = 1; i < n; i++)
    {
        grid[0][i] += grid[0][i - 1];
    }

    if (grid.size() == 1) return grid[0][m - 1];


    for (int j = 1; j < m; j++)
    {
        grid[j][0] += grid[j - 1][0];
    }


    for (int i = 1; i < n; i++)
    {
        for (int j = 1; j < m; j++)
        {
            grid[i][j] += max(grid[i - 1][j], grid[i][j - 1]);
        }
    }
    return grid[n - 1][m - 1];
}

void Test1()
{
    vector<vector<int>> dp;
    vector<int> tmp = { 9,1,4,8 };
    dp.push_back(tmp);
    cout << maxValue(dp);

}
#include <numeric>
void Test2()
{
    int a = 10, b = 5;
    //int c = __gcd(a, b);
}
#include <iostream>
#include <vector>
#include <string>

using namespace std;

bool find(string& str1, string& str2)
{
    int hx[100000] = { 0 };
    for (int i = 0; i < str2.size(); i++)
    {
        hx[str2[i]]++;
    }
    for (int i = 0; i < str1.size(); i++)
    {
        if (hx[str1[i]] != 0) return true;
    }
    return false;
}

int main()
{
    int n;
    cin >> n;
    while (n--)
    {
        int i; cin >> i;

        vector<string> v(i);

        for (auto& e : v)
        {
            cin >> e;
        }

        int a = 0, b = v.size() - 1;
        while (a < b)
        {
            if (!find(v[a], v[b]))
            {
                cout << "No" << endl;
                break;
            }
            a++;
            b--;
        }
        if (a >= b)
        {
            cout << "Yes" << endl;
        }
    }
    return 0;
}
int main()
{
	Test2();
	return 0;
}